//
//  WYDirectCommonView.m
//  CirclePush
//
//  Created by admin on 2018/4/25.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYDirectCommonView.h"

@implementation WYDirectCommonView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews {
    //
    UIView *BGView = [[UIView alloc]init];
    BGView.backgroundColor = [UIColor whiteColor];
    [self addSubview:BGView];
    [BGView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.left.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(ScreenWidth, SYRealValue(80 / 2)));
    }];
    //
    UIView *PlaceholderView = [[UIView alloc]init];
    PlaceholderView.backgroundColor = [UIColor redColor];
    [BGView addSubview:PlaceholderView];
    [PlaceholderView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(BGView.mas_centerY);
        make.left.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(SYRealValue(10 / 2), SYRealValue(30 / 2)));
    }];
    //
    self.TitleLabel = [[UILabel alloc]init];
    self.TitleLabel.font = [UIFont systemFontOfSize:SYRealValue(30 / 2)];
    [BGView addSubview:self.TitleLabel];
    [self.TitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(BGView).with.offset(0);
        make.left.equalTo(PlaceholderView.mas_right).with.offset(SYRealValue(10 / 2));
        make.size.mas_equalTo(CGSizeMake(SYRealValue(300 / 2), SYRealValue(80 / 2)));
    }];
}

@end
